package com.replication.constants;

/**
 * Created by yangshoujun on 2016/3/7 10:43.
 */
public enum DBType {

    MASTER("master"),

    SLAVE("slave");

    private String type;

    DBType(String type) {
        this.type = type;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public static DBType getDbType(String type) {
        DBType[] types = DBType.values();
        for(DBType t : types) {
            if(t.getType().equals(type)) {
                return t;
            }
        }
        return null;
    }
}
